main(n)
{
	for(gets(&n);~scanf("%d",&n);)
		printf(n&1||n==2?"NO\n":"%d %d\n",2,n-2);
}
